package com.example.hello.service.impl;


import com.example.hello.model.Category;
import com.example.hello.repository.CategonyRepository;
import com.example.hello.repository.DrinkRepository;
import com.example.hello.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class CategoryJpaService implements ICategoryService {
    @Autowired
    public CategonyRepository categonyRepository;
    @Autowired
    public DrinkRepository drinkRepository;

    @Override
    public List<Category> getAll(){
        List<Category> categoryList=categonyRepository.findAll();
        return categoryList;
    }
}
